angular.module('mamApp').factory('CommonManager', ['$http', 'api', 'paramsManager', function ($http, api, paramsManager) {
    var CommonManager = {

        /**
         * 获取用户审核列表
         * @param params
         * @returns
         */

        cpList: function (params, query) {
            return $http.get(api + '/admin/common/cp/userlist/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 获取合约
         * @param params
         * @returns
         */

        contractList: function (params, query) {
            return $http.get(api + '/admin/common/contracts/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 通用标签列表
         * @returns {*}
         */
        commonTagsList: function () {
            return $http.get(api + '/admin/common/tags/commtags').then(function (result) {
                return result;
            });
        },
        /**
         * 专用标签列表
         * @param channelId
         * @returns {*}
         */
        specialTagsList: function (channelId) {
            return $http.get(api + '/admin/common/tags/'+channelId+'/specialtags').then(function (result) {
                return result;
            });
        },
        /**
         * 获取一级频道列表
         * @returns {*}
         */
        categoriesList: function () {
            return $http.get(api + '/admin/common/tags/categories').then(function (result) {
                return result;
            });
        },
        /**
         * 获取所有二级频道列表
         * @returns {*}
         */
        channelAllList: function () {
            return $http.get(api + '/admin/common/tags/channels').then(function (result) {
                return result;
            });
        },
        /**
         * 获取一级频道下所有二级频道列表
         * @param categoryId
         * @returns {*}
         */
        channelList: function (categoryId) {
            return $http.get(api + '/admin/common/tags/channels/'+categoryId).then(function (result) {
                return result;
            });
        },




    };

    return CommonManager;
}]);
